package com.itheima.idea;

import java.util.Scanner;

public class importantexple {
    public static void main(String[] args) {
        int[] arr = new int[6];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第" + (i + 1) + "个评委的打分");
            int score = sc.nextInt();
            if (score >= 0 && score <= 100) {
                arr[i] = score;
            } else {
                System.out.println("您的打分输入有误，请检查是否是1-100之间的");
                i--;
            }

       }//求出数组最大值
        int max = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (max < arr[i]) {
                max = arr[i];
            }

        }//求出数组最小值
        int min = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (min > arr[i]) {
                min = arr[i];
            }
      }//求出数组总和
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];

      /*  }//按照计算规则进行计算得到平均分
        int avg = (sum - max - min) / 4;
        //输出平均值
        System.out.println(avg);*/
        }
        System.out.println("sum" + sum);
    }
}






